class GameProfiler
{
    static s_time = 0;
    static s_fps = 0;
    public _countTime;
    public _lastTime;
    public _fps;
    public constructor(b)
    {
        this._countTime = this._lastTime = this._fps = 0;
        this.run(b);
    }
    public run(b)
    {
        b.addEventListener(egret.Event.ENTER_FRAME,this.calculateFPS,this);
    }
    public calculateFPS()
    {
        var d = egret.getTimer(),
            e = d - this._lastTime;
        this._countTime += e;
        1E3 <= this._countTime && (this._countTime = 0,GameProfiler.s_time++);
        this._fps = 1E3 / e;
        this._lastTime = d;
        GameProfiler.s_fps = this._fps;
    }
}